package com.okq.service.Impl;

import com.okq.dao.CompanyDao;
import com.okq.entity.Company;
import com.okq.service.ICompanyService;
import com.okq.util.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 描述 : 公司业务接口实现
 * 作者 : zdl
 * 日期 : 2017/6/28 13:46
 */
@Transactional
@Service
public class CompanyServiceImpl implements ICompanyService {

    @Autowired
    private CompanyDao companyDao;


    @Override
    public void saveCompany(Company company) {
        companyDao.saveCompany(company);
    }

    @Override
    public void deleteCompany(Company company) {
        companyDao.deleteCompany(company);
    }

    @Override
    public void updateCompany(Company company) {
        companyDao.updateCompany(company);
    }

    @Override
    public void saveOrUpdateCompany(Company company) {
        companyDao.saveOrUpdateCompany(company);
    }

    @Override
    public Company getCompanyById(String id) {
        return companyDao.getCompanyById(id);
    }

    @Override
    public List<Company> listAllCompany() {
        return companyDao.listAllCompany();
    }

    @Override
    public Page<Company> pageByCompany(Page<Company> page, Company company) {
        return companyDao.pageByCompany(page, company);
    }

    @Override
    public Company getCompanyByName(String name) {
        return companyDao.getCompanyByName(name);
    }

    @Override
    public Company getLastCompany() {
        return companyDao.getLastCompany();
    }

    @Override
    public Company getCompanyByComCode(String comCode) {
        return companyDao.getCompanyByComCode(comCode);
    }
}
